package com.javaweb.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.javaweb.admin.entity.NcOnhand;
import org.apache.ibatis.annotations.Select;
import java.util.List;

public interface NcOnhandMapper extends BaseMapper<NcOnhand> {

    @Select("select top 1 orgcode from v_nc_onhand where invcode=#{invcode} and vlotno=#{vlotno}")
    String getOrgcodeByInvcodeLotno2(String invcode,String vlotno);

    @Select("select top 1 companycode from kdl_purchasein t1 inner join kdl_purchasein_b t2 on t1.id=t2.pid  where materialcode=#{invcode} and vendorbatch=#{vlotno}")
    String getOrgcodeByInvcodeLotno(String invcode,String vlotno);

    @Select("select distinct companycode from kdl_purchasein t1 inner join kdl_purchasein_b t2 on t1.id=t2.pid  where materialcode=#{invcode} and vendorbatch=#{vlotno}")
    List<String> getOrgcodeList(String invcode,String vlotno);
}
